package com.gugee.tiktok.common.model.es;


import com.gugee.tiktok.common.model.mysql.BloggerMain;
import lombok.Data;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

import java.util.List;

@Data
public class ESBlogger extends ESBloggerFansPortrait {
    private long id;
    private long uid;
    private String avatar168;
    private String avatar300;
    private String avatarMedium;
    private String avatarLarger;
    private int followerCount;
    private long avgViews;
    private long avgLikes;
    private long avgReviews;
    private long avgShare;
    private String signature;
    private String coverUrl;
    private String totalFavorited;
    private String dongtaiCount;
    private int gender;
    private int awemeCount;
    private String nickName;
    private double score;
    private long roomId;
    private String region;
    private String uniqueId;
    private String bloggerType;

    private String enterpriseVerifyReason;
    private String customVerify;
    private boolean withFusionShopEntry;
    private String youtubeChannelId;
    private String twitterId;
    private String insId;
    private String bioEmail;
    private String bioUrl;
    private int aiAge;
    private int aiGender;
    /**
     * 播主标签 类型不匹配引发es根新错误
     */
    // private String tags;

    @Mapper(componentModel = "spring")
    public interface ESBloggerMapper{

        @Mapping(source = "id", target = "id")
        @Mapping(source = "OUid", target = "uid")
        @Mapping(source = "OAvatar168", target = "avatar168")
        @Mapping(source = "OAvatar300", target = "avatar300")
        @Mapping(source = "OAvatarMedium", target = "avatarMedium")
        @Mapping(source = "OAvatarLarger", target = "avatarLarger")
        @Mapping(source = "OFollowerCount", target = "followerCount")
        @Mapping(source = "OAvgViews", target = "avgViews")
        @Mapping(source = "OAvgLikes", target = "avgLikes")
        @Mapping(source = "OAvgReviews", target = "avgReviews")
        @Mapping(source = "OAvgShare", target = "avgShare")
        @Mapping(source = "OSignature", target = "signature")
        @Mapping(source = "OCoverUrl", target = "coverUrl")
        @Mapping(source = "OTotalFavorited", target = "totalFavorited")
        @Mapping(source = "ODongtaiCount", target = "dongtaiCount")
        @Mapping(source = "OGender", target = "gender")
        @Mapping(source = "OAwemeCount", target = "awemeCount")
        @Mapping(source = "ONickname", target = "nickName")
        @Mapping(source = "score", target = "score")
        @Mapping(source = "ORoomId", target = "roomId")
        @Mapping(source = "ORegion", target = "region")
        @Mapping(source = "OUniqueId", target = "uniqueId")
        @Mapping(source = "bloggerType", target = "bloggerType")

        @Mapping(source = "enterpriseVerifyReason", target = "enterpriseVerifyReason")
        @Mapping(source = "customVerify", target = "customVerify")
        @Mapping(source = "withFusionShopEntry", target = "withFusionShopEntry")
        @Mapping(source = "youtubeChannelId", target = "youtubeChannelId")
        @Mapping(source = "twitterId", target = "twitterId")
        @Mapping(source = "insId", target = "insId")
        @Mapping(source = "bioEmail", target = "bioEmail")
        @Mapping(source = "bioUrl", target = "bioUrl")
        //@Mapping(source = "tags", target = "tags")

        ESBlogger mapper(BloggerMain bloggerMain);

        List<ESBlogger> mapper(List<BloggerMain> bloggerMain);

    }


}
